Try to load css themes from the XDG config directory first
authorWilliam Jon McCann <jmccann@redhat.com>
Fri, 27 Apr 2012 16:32:18 +0000 (12:32 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 30 Apr 2012 10:42:33 +0000 (06:42 -0400)
Will fall back to previous locations.

https://bugzilla.gnome.org/show_bug.cgi?id=646631

gtk/gtkcssprovider.c

index a2df0f0386b6aada403f17e2e71361ac586f8f63..9045498ee9ba3e26c20b341e4d607caf2d003246 100644 (file)
@@ -2719,7 +2719,6 @@ gtk_css_provider_get_named (const gchar *name,
 
   if (!provider)
     {
-      const gchar *home_dir;
       gchar *subpath, *path = NULL;
 
       if (variant)
@@ -2727,17 +2726,31 @@ gtk_css_provider_get_named (const gchar *name,
       else
         subpath = g_strdup ("gtk-3.0" G_DIR_SEPARATOR_S "gtk.css");
 
-      /* First look in the users home directory
+      /* First look in the user's config directory
        */
-      home_dir = g_get_home_dir ();
-      if (home_dir)
+      path = g_build_filename (g_get_user_data_dir (), "themes", name, subpath, NULL);
+      if (!g_file_test (path, G_FILE_TEST_EXISTS))
         {
-          path = g_build_filename (home_dir, ".themes", name, subpath, NULL);
+          g_free (path);
+          path = NULL;
+        }
 
-          if (!g_file_test (path, G_FILE_TEST_EXISTS))
+      /* Next look in the user's home directory
+       */
+      if (!path)
+        {
+          const gchar *home_dir;
+
+          home_dir = g_get_home_dir ();
+          if (home_dir)
             {
-              g_free (path);
-              path = NULL;
+              path = g_build_filename (home_dir, ".themes", name, subpath, NULL);
+
+              if (!g_file_test (path, G_FILE_TEST_EXISTS))
+                {
+                  g_free (path);
+                  path = NULL;
+                }
             }
         }